// pages/adress/adress.js
Page({
  data: {
    chose:0,
    adress: [{ info: '未来国际商务大厦1楼1号', tel: '13594807017', name: '王洪强', id: '1' }, { info: '未来国际商务大厦1楼1号-2', tel: '13594807017', name: '王洪强', id: '1' }]
  },
  edit:function(e){
    let id = e.currentTarget.dataset.id;
   wx.navigateTo({
      url: '../place/place?id='+id
    })
  },
  pick:function(e){
    let index = e.currentTarget.dataset.index; 
    this.setData({
      chose:index
    })
  },
  del: function (e) {
    let that = this;
      wx.showModal({
        title: '提示',
        content: '确定要删除该地址？',
        success: function (sm) {
          if (sm.confirm) {
            let index = e.currentTarget.dataset.index;
            var data = that.data.adress;
            data.splice(index, 1);
            that.setData({
              adress: data
            })
          } else if (sm.cancel) {
          }
        }
      })

  },
  onLoad: function () {
  },    
  onReady: function () {
  }
})